<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        .djinput{border-top:1px solid #eee;border-bottom:1px solid #eee;border-right:0;padding: 8px 0;background: #fff;}
        .djcopy{color:red;padding-top: 10px;font-size: 14px;}
    </style>
</head>
<body>
<div  style="padding-top:50px;">
    <div id="teacher" style="width:200px;height：200px;margin:0 auto;;">

    </div>
    <div class="djinput" style=" word-wrap: break-word;word-break: break-all;margin-bottom: 15px;text-align:center;margin-top:25px">{$url_arr.qr_s}</div>
    <div style="text-align: center">
        <p class="djcopy" onclick="copyTo()">
            <i class="iconfont icon-fuzhi"></i>
            点此复制
        </p>
        <div style="height:24px;">
            <p id="tishi" style="display: none;font-size: 14px;">复制成功</p>
        </div>
    </div>
    <input type="text" value="{$url_arr.qr_s}" id="valCopy" style="opacity: 0;">
</div>
<script type="text/javascript" src="__STATIC__/admin/lib/jquery/1.9.1/jquery.min.js"></script>

<script type="text/javascript" src="__STATIC__/qrcode/qrcode.min.js"></script>
<script type="text/javascript">
    // 点击复制
    function copyTo() {
        document.getElementById("valCopy").select();
        document.execCommand("Copy");
        $("#tishi").show();
        setTimeout(function () {
            $("#tishi").hide();
        },3000);
    }

    // 生成二维码
    function makeCode (url,dom) {
        var qrcode = new QRCode(document.getElementById(dom), {
            width : 200,
            height : 200
        });
        qrcode.makeCode(url);
    }

    // 生成对应的二维码
    makeCode("{$url_arr.qr_s}",'teacher');

</script>
</body>
</html>
